package com.star.sync.elasticsearch.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class LogUtil {
    private  Logger logger = null;

    private LogUtil(){

    }
    public LogUtil(String loggerName){
        logger = LoggerFactory.getLogger(loggerName);
    }
    public LogUtil(Class<?> clazz){
        logger = LoggerFactory.getLogger(clazz);
    }


    public  void error(String s){
        if(logger.isErrorEnabled()){
            logger.error(s);
        }
    }
    public  void error(String s,Throwable e){
        if(logger.isErrorEnabled()){
            logger.error(s,e);
        }
    }

    public  void info(String s){
        if(logger.isInfoEnabled()){
            logger.info(s);
        }
    }
    public  void info(String s,Throwable e){
        if(logger.isInfoEnabled()){
            logger.info(s,e);
        }
    }

    public  void debug(String s){
        if(logger.isDebugEnabled()){
            logger.debug(s);
        }
    }
    public  void debug(String s,Throwable e){
        if(logger.isDebugEnabled()){
            logger.debug(s,e);
        }
    }

    public  void warn(String s){
        if(logger.isWarnEnabled()){
            logger.warn(s);
        }
    }
    public  void warn(String s,Throwable e){
        if(logger.isWarnEnabled()){
            logger.warn(s,e);
        }
    }

    public static void  main(String[] args){
        //c4ca4238a0b923820dcc509a6f75849b
        //c51ce410c124a10e0db5e4b97fc2af39
        //1d2ed84d2b137117d860027dd8b9393d
    }
}
